alert("The PrintOMatic Xtra is not installed. Printing is disabled.")
exit
end if
set doc to new(xtra("PrintOMatic"))
if not objectp(doc) then
alert("There is no currently selected printer. Printing features are disabled.")
else
cursor(4)
setDocumentName(doc, "PrintOMatic Xtra Order Form")
setMargins(doc, rect(0, 0, 0, 0))
set h to the height of member "inkspots" * getPageWidth(doc) / the width of member "inkspots"
drawPicture(doc, member "inkspots", rect(0, getPageHeight(doc) - h, getPageWidth(doc), getPageHeight(doc)))
drawPicture(doc, member "logo", rect(12, 72, 160, 244))
newPage(doc)
newFrame(doc, rect(144, 72, 144 + the width of member "name&address", getPageHeight(doc)), 0)
setTextJust(doc, "center")
append(doc, member "ordertitle", 0)
set the itemDelimiter to ","
set y to integer(item 3 of getInsertionPoint(doc))
newFrame(doc, rect(144, y, 144 + the width of member "name&address", getPageHeight(doc)), 0)
setTextJust(doc, "left")
append(doc, member "orderIntro", 0)
setTextLineSpacing(doc, 16)
append(doc, member "name&address", 0)
set y to integer(item 3 of getInsertionPoint(doc))
newFrame(doc, rect(144, y, 144 + the width of member "name&address" - the width of member "priceCol", getPageHeight(doc)), 0)
setTextLineSpacing(doc, 11)
append(doc, member "productCol", 0)
set bottom to integer(item 3 of getInsertionPoint(doc))
newFrame(doc, rect(144 + the width of member "name&address" - the width of member "priceCol", y, 144 + the width of member "name&address", getPageHeight(doc)), 0)
setTextJust(doc, "right")
setTextLineSpacing(doc, 11)
append(doc, member "priceCol", 0)
newFrame(doc, rect(144, bottom, 144 + the width of member "name&address", getPageHeight(doc)), 0)
append(doc, member "ordertotal", 0)
set bottom to integer(item 3 of getInsertionPoint(doc))
setTextJust(doc, "left")
newFrame(doc, rect(144, bottom, 144 + the width of member "name&address", getPageHeight(doc)), 0)
append(doc, member "endinfo", 0)
cursor(-1)
if word 1 of the text of cast the castNum of sprite the clickOn = "Preview" then